import h5py
import numpy as np

fileName = 'test_catvnoncat.h5'
filePath = './file/'
h5f = h5py.File(filePath + fileName, 'r')

print([key for key in h5f.keys()])  # 打印h5文件中的所有group

test_set_x = np.array(h5f['test_set_x'])  # 创建以h5中test_set_x这一group数据为内容的numpy类型array矩阵
print(test_set_x)
print('test_set_x shape:', test_set_x.shape)
print('test_set_x type:', type(test_set_x))
print('test_set_x dtype:', test_set_x.dtype)


